﻿//        Another Demo from Andy L. & MissedMemo.com
// Borrow whatever code seems useful - just don't try to hold
// me responsible for any ill effects. My demos sometimes use
// licensed images which CANNOT legally be copied and reused.


namespace MissedMemo.MeatAndCheeseDisc.BusinessLogic
{
    public enum PizzaType { Custom, Combo, Veggie, MeatMania, Cheese }
    public enum PizzaSize { FamilySize, Large, Medium, Small, Mini }


    public class Pizza
    {
        private PizzaType _type;
        private PizzaSize _size;
        private double _cost;


    #region Properties...

        public PizzaType ItemType
        {
            get { return _type; }
            set
            {
                _type = value;
                Cost = PriceLookerUpper.Price( ItemType, Size );
            }
        }

        public PizzaSize Size
        {
            get { return _size; }
            set
            {
                _size = value;
                Cost = PriceLookerUpper.Price( ItemType, Size );
            }
        }

        public double Cost
        {
            get { return _cost; }
            set { _cost = value; }
        }

    #endregion (Properties)


        public Pizza Clone()
        {
            // Perform a shallow copy of all value fields...
            Pizza copy = (Pizza)MemberwiseClone();

            // Then, make deep copies of any reference fields...
            // (this class currently has none)
            
            return copy;
        }
    }
}
